using System;

namespace InfiniteGeek.Util
{
	/// <summary>Declares to AutoConfig that the decorated class should read from the specified ConfigSection instead of the default of Namespace.</summary>
	/// <remarks>Use &lt;GroupName>/&lt;SectionName> to load a ConfigurationSection from a ConfigurationSectionGroup.</remarks>
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Module)]
	public sealed class AutoConfigSectionAttribute : Attribute
	{
		/// <summary>The name of the configuration section that should be loaded into the decorated property.</summary>
		public String Name { get; private set; }

		/// <summary>Initializes a new instance of <see cref="AutoConfigSectionAttribute"/>.</summary>
		/// <param name="name">A string that specifies the configuration section associated with the decorated class. </param>
		public AutoConfigSectionAttribute(String name) { Name = name; }
	}
}